﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Application.Services.Dto;
using FutureApp.Person.Dto;
using Abp.Domain.Repositories;
using Abp.UI;
using Abp.AutoMapper;
using Abp.Domain.Uow;
using FutureApp.Shop;
using FutureApp.Cms.Dto;


namespace FutureApp.Person
{
    /// <AppService/>
    public class PersonAppService : FutureAppAppServiceBase, IPersonAppService
    {
        private IRepository<Student, Guid> studentRepository { get; }

        private IRepository<Course, Guid> courseRepository { get; }

        //private IRepository<OrderLine, Guid> dTestRepository { get; }

        /// <constructor/>
        public PersonAppService(
            IRepository<Student, Guid> r1,
             IRepository<Course, Guid> r2
        )
        {
            this.studentRepository = r1;
            this.courseRepository = r2;

        }




        public async Task<StudentDto> Get(Guid id)
        {
            var entity = await this.studentRepository.GetAsync(id);         
            return entity.MapTo<StudentDto>();
        }
        public async Task<CourseDto> GetStudent(Guid id)
        {
            var entity = await this.courseRepository.GetAsync(id);
            return entity.MapTo<CourseDto>();
            // throw new NotImplementedException();
        }

    }
}
